<?php
namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Models\Circular;
use Illuminate\Http\Request;

class CircularController extends Controller {

    /**
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     * 通告列表
     */
    public function list(Request $request){
        $limit = $request->limit?? 6;
        $list = Circular::orderBy('id','asc')->paginate($limit);
        $data = [
            'list' => $list->items(),
            'current_page' => $list->currentPage(),
            'per_page' => $list->perPage(),
            'total' => $list->count(),
        ];
        return responseJson(200, '成功', $data);
    }
}
